SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 48146: Example for INFILE statement is incorrect in SAS Companion for Windows

DetailsAboutRate It
The SAS Companion for Windows has an example showing how to list multiple files in an INFILE statement. It is incorrect. SAS requires another set of quotation marks around the parentheses. In this example, since single quotation marks are used around the file names, double quotation marks should be used around the entire string. That can be reversed.

The documentation shows this incorrect syntax.
data new;
infile ('c:\myfiles\*.*','c:\myotherfiles\abc.dat');
input;
run;

The correct syntax is
data new;
infile "('c:\myfiles\*.*','c:\myotherfiles\abc.dat')";
input;
run;
If you use the incorrect syntax, you may get an ERROR in your log:
1562  infile ('c:\testin\*.*','c:\temp\testthis.txt');
                                                     -
                                                     22
                                                     76
ERROR: Undeclared array referenced: infile.
ERROR 22-322: Syntax error, expecting one of the following: +, =.

ERROR 76-322: Syntax error, statement will be ignored.


Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemBase SASMicrosoft® Windows® for x649.39.49.3 TS1M29.4 TS1M0
Microsoft Windows Server 2003 Datacenter Edition9.39.49.3 TS1M29.4 TS1M0
Microsoft Windows Server 2003 Enterprise Edition9.39.49.3 TS1M29.4 TS1M0
Microsoft Windows Server 2003 Standard Edition9.39.49.3 TS1M29.4 TS1M0
Microsoft Windows Server 2003 for x649.39.49.3 TS1M29.4 TS1M0
Microsoft Windows Server 20089.39.49.3 TS1M29.4 TS1M0
Microsoft Windows Server 2008 for x649.39.49.3 TS1M29.4 TS1M0
Microsoft Windows XP Professional9.39.49.3 TS1M29.4 TS1M0
Windows 7 Enterprise 32 bit9.39.49.3 TS1M29.4 TS1M0
Windows 7 Enterprise x649.39.49.3 TS1M29.4 TS1M0
Windows 7 Home Premium 32 bit9.39.49.3 TS1M29.4 TS1M0
Windows 7 Home Premium x649.39.49.3 TS1M29.4 TS1M0
Windows 7 Professional 32 bit9.39.49.3 TS1M29.4 TS1M0
Windows 7 Professional x649.39.49.3 TS1M29.4 TS1M0
Windows 7 Ultimate 32 bit9.39.49.3 TS1M29.4 TS1M0
Windows 7 Ultimate x649.39.49.3 TS1M29.4 TS1M0
Windows Vista9.39.49.3 TS1M29.4 TS1M0
Windows Vista for x649.39.49.3 TS1M29.4 TS1M0
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.